<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/8/9
 * Time: 15:21
 */

class MY_Controller extends CI_Controller{

}

/**
 * 后台控制器基类
 */
class Admin_Controller extends MY_Controller{

    /**
     * Admin_Controller constructor.
     * @param array $arr_not_check 不需要判断权限的控制器方法数组
     */
    public function __construct($arr_not_check=array())
    {
        parent::__construct();
        $this->load->model('comm_model');
        $this->load->model('admin_model');
        $this->load->helper('html');

        if (!in_array($this->router->method,$arr_not_check) && !$this->admin_model->logged_in())
        {
            alert_and_redirect('您还没有登录！','admin/index/login');
        }

        header("Content-type:text/html;charset=utf-8");
    }
}
